package com.homegoods.videomodule.item;

import com.homegoods.videomodule.R;
import com.homegoods.videomodule.model.LiveShowModel;
import com.kedll.library.adapter.MultiTypeAdapter;
import com.kedll.library.mvp.BaseItem;
import com.kedll.library.util.Parse;

/**
 * @author QiQi
 * @ClassName: LiveShowItem
 * @date 2018/10/25
 * @description
 */
public class LiveShowItem extends BaseItem<LiveShowModel> {
    public LiveShowItem(LiveShowModel data, MultiTypeAdapter adapter) {
        super(data);
        setOnClickListener(view -> {
            if (adapter.getOnItemClickListener() != null) {
                adapter.getOnItemClickListener().onItemClicked(view, this);

            }
        });
    }


    public String getTitle() {
        return getData().getTitle();
    }

    public String getImgUrl() {
        return getData().getImgUrl();
    }

    public String getShower() {
        return getData().getShower();
    }

    public String getPopularity() {
        return Parse.getInstance().parse2CNString(getData().getPopularity(), 2) + "人气";
    }

    @Override
    public int getLayout() {
        return R.layout.video_item_live_show_layout;
    }
}
